<%@ page import="de.app.fbc.teams.Verein" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Verein List</title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${resource(dir:'')}">Home</a></span>
            <span class="menuButton"><g:link class="create" action="create">New Verein</g:link></span>
        </div>
        <div class="body">
            <h1>Verein List</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                        	<th/>
                        	<g:sortableColumn property="vereinsname" title="Vereinsname" />
                   	        <g:sortableColumn property="beschreibung" title="Beschreibung" />
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${vereinInstanceList}" status="i" var="vereinInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                           <td>
                           <img width="20%" height="20%" src="${createLink(controller:'verein', action:'getImageBytes', id:vereinInstance.key.id)}"/>
                           </td>
                           <td>${fieldValue(bean:vereinInstance, field:'beschreibung')}</td>
                           <td>${fieldValue(bean:vereinInstance, field:'vereinsname')}</td>
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${vereinInstanceTotal}" />
            </div>
        </div>
    </body>
</html>
